<!--微信分享-->

<div class="bds_share" style="display:none">
	<img src="{IMG_PATH2}icon/icon_sharesor.png" class="btn_share">
	<img src="{IMG_PATH2}icon/shareText.png" class="shareText">
</div>

<div class="sharepark" id="idsharepark">
    <div class="bdsharebuttonbox" data-tag="share_1">
        <a class="bds_tsina" data-cmd="tsina"></a>
        <a class="bds_weixin" data-cmd="weixin"></a>
        <a class="bds_qzone" data-cmd="qzone"></a>
        <a class="bds_tqq" data-cmd="tqq"></a>
    </div>
</div>
<script type="text/javascript">
$(function() {
	$('.icon_share').click(function() {
		$('#idsharepark').show();
		$(window).scroll(function() {　
			$('#idsharepark').hide();
		});
	});

	$('a.bds_weixin').click(function(e){
		
		if(!is_pc()){

			e.stopPropagation();
			$(".bds_share").show();
			var _catid = $('html').data('catid');
			var _id = $('html').data('id');
			$.ajax({
				type: 'post',
				url: '/index.php?m=api&c=share&a=add',
				data: {
					'catid': _catid,
					'id': _id,
					'pc': 'freind'
				},
				success: function(res) {}
			});

			$('#idsharepark').hide();
		}
	});

	$(".bds_share").click(function(){
		$(this).hide();
	});

});
var winwidth = $(window).width();
var winmar = (winwidth / 8) - 35;

$('#idsharepark .bdsharebuttonbox a').css({
	'marginLeft': winmar,
	'marginRight': winmar
});

var shtext = '{$title}',
	shdesc = '{str_cut(str_replace(["\r\n", "\r", "\n"], '', $small_content),180,'..')}',
	shurl = '{$url}',
	shpic = '{$thumb}';

window._bd_share_config = {
	common: {
		bdText: shtext,
		bdDesc: shdesc,
		bdUrl: shurl,
		bdPic: shpic,
		onAfterClick: function(pc) {
			var _catid = $('html').data('catid');
			var _id = $('html').data('id');
			$.ajax({
				type: 'post',
				url: '/index.php?m=api&c=share&a=add',
				data: {
					'catid': _catid,
					'id': _id,
					'pc': pc
				},
				success: function(res) {}
			});

			$('#idsharepark').hide();
		}
	},
	share: [{
		"bdSize": 16
	}]
}

with(document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?cdnversion=' + ~(-new Date() / 36e5)];
function is_pc(){    
     var userAgentInfo = navigator.userAgent;  
     var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");    
     var flag = true;    
     for (var v = 0; v < Agents.length; v++) {    
         if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = false; break; }    
     }    
     return flag;    
  }  
</script>
